<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>弹出层</title>
	<style type="text/css">
		.btn{
			display: block;
			background-color: red;
			border-radius: 50%;
			width: 50px;
			height: 50px;
			text-align: center;
			line-height: 50px;
			cursor: pointer;
		}
		.bg{
			width: 100%;
			height: 100%;
			background: rgba(0,0,0,0.8) url() 0 0 no-repeat;
			position: absolute;
			top: 0px;
			left: 0px;
			display: none;
		}
		.box{
			height: 300px;
			width: 300px;
			position: absolute;
			top: 50%;
			left: 50%;
			margin-top: -150px;
			margin-left: -150px;
			background-color: white;
			display: none;
		}
	</style>
	<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.min.js"></script>
	<script type="text/javascript">
		$(function(){
			$('.btn').click(function(event) {
				$('.bg').slideDown();
				$('.box').slideDown();
			});
			$('.bg').click(function(event) {
				$('.bg').hide();
				$('.box').hide();
			});
		})
	</script>
</head>
<body>
	<span class="btn">按钮</span>
	<div class="bg"></div>
	<div class="box"></div>
</body>
</html>